<div class="row-content am-cf">

    <div class="row">

        <div class="am-u-sm-12 am-u-md-12 am-u-lg-12">
            <div class="widget am-cf">
                <div class="widget-head am-cf">
                    <div class="widget-title am-fl">新增账号</div>

                </div>
                <div class="widget-body am-fr">

                    <form class="am-form tpl-form-line-form">
                        <div class="am-form-group">
                            <label for="user-name" class="am-u-sm-3 am-form-label">用户名<span class="tpl-form-line-small-title" disabled>Username</span></label>
                            <div class="am-u-sm-9">
                                <input type="text" class="tpl-form-input" id="username" placeholder="请输入用户名" value="{{ page['update'].username }}">

                            </div>
                        </div>





                        <div class="am-form-group">
                            <label class="am-u-sm-3 am-form-label">密码<span class="tpl-form-line-small-title">Password</span></label>
                            <div class="am-u-sm-9">
                                <input type="text" placeholder="请输入密码" id="password" value="{{ page['update'].password }}">
                            </div>
                        </div>



                        <div class="am-form-group">
                            <label for="user-weibo" class="am-u-sm-3 am-form-label">用户组<span class="tpl-form-line-small-title">Group</span></label>
                            <div class="am-u-sm-9">
                                <input type="text" placeholder="用户组用';'隔开" id="groups" value="{{ page['update'].groups }}">
                                <div>

                                </div>
                            </div>
                        </div>





                        <div class="am-form-group">
                            <div class="am-u-sm-9 am-u-sm-push-3">
                                <button type="button" class="am-btn am-btn-primary tpl-btn-bg-color-success " id="update">提交</button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
<script src="../static/js/amazeui.min.js"></script>
<script src="../static/js/amazeui.datatables.min.js"></script>
<script src="../static/js/dataTables.responsive.min.js"></script>
<script src="../static/js/app.js"></script>
<script>
    $('#update').click(function() {
            $('#update').active = false
            $.getJSON('/mapi/' + $('#username').val() + '/update?password=' + $('#password').val() + '&groups=' + $('#groups').val(),function(data){
                alert(data['msg'])
                if (data['state'] == 200){
                    window.location.href='?page=users'
                }else{

                }
                $('#update').active = true

            })
        });
</script>




</div>